<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/9/8
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/include.jsp" %>
<html>
<head>
    <title>Title</title>
    <!-- css -->

    <style>
        .mar {
            margin-top: 8px;
        }
    </style>
    <script type="text/javascript">
        var serverIp = "localhost:8080";
        var editor1 = null;
        $(function () {
            $(".col-sm-4").addClass("mar");
            $(".col-sm-8").addClass("mar");
            $(".col-sm-10").addClass("mar");
        });

    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <form class="form-horizontal" id="demandForm" name="demandForm">
        <div class="tabs-container">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a data-toggle="tab" href="#tab-1" aria-expanded="true"> <i
                            class="fa fa-angle-double-right"></i> 进度</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-2" aria-expanded="false"> <i
                            class="fa fa-file-text-o"></i> 暂停记录</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-3" aria-expanded="false"> <i
                            class="fa fa-refresh"></i> 转移记录</a>
                </li>
            </ul>
            <div class="tab-content" style="font-size: 13px">


                <div id="tab-1" class="tab-pane active">
                    <div class="panel-body">
                        <fieldset>


                            <div>
                                <div class="form-group">
                                    <!-- 一条进度开始 -->

                                    <div class="col-xs-1 loopitem loopitem_active col-xs-offset-4">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png?2017" alt="">
                                        </div>
                                        <p class="textarea">
                                            待审核
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>

                                    <!-- 一条进度结束 -->
                                    <!-- 一条进度开始 -->
                                    <c:if test="${resultMap.maxPro.status >=2}">
                                        <div class="col-xs-1 loopitem loopitem_active">
                                            <div class="colorbox">
                                                <img src="h/img/process_active.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                已审核
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                    <c:if test="${resultMap.maxPro.status <2 || resultMap.maxPro.status == null }">
                                        <div class="col-xs-1 loopitem loopitem">
                                            <div class="colorbox">
                                                <img src="h/img/process_grey.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                已审核
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                    <!-- 一条进度结束 -->
                                    <!-- 一条进度开始 -->
                                    <c:if test="${resultMap.maxPro.status >=3}">
                                        <div class="col-xs-1 loopitem loopitem_active">
                                            <div class="colorbox">
                                                <img src="h/img/process_active.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                处理中
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                    <c:if test="${resultMap.maxPro.status <3 || resultMap.maxPro.status == null }">
                                        <div class="col-xs-1 loopitem">
                                            <div class="colorbox">
                                                <img src="h/img/process_grey.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                处理中
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                    <!-- 一条进度结束 -->
                                    <!-- 一条进度开始 -->
                                    <c:if test="${resultMap.maxPro.status >=4}">
                                        <div class="col-xs-1 loopitem loopitem_active">
                                            <div class="colorbox">
                                                <img src="h/img/process_active.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                已处理
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                    <!-- 一条进度结束 -->
                                    <c:if test="${resultMap.maxPro.status <4 || resultMap.maxPro.status == null }">
                                        <div class="col-xs-1 loopitem">
                                            <div class="colorbox">
                                                <img src="h/img/process_grey.png?2017" alt="">
                                            </div>
                                            <p class="textarea">
                                                已处理
                                            </p>
                                            <div class="dir_line"></div>
                                        </div>
                                    </c:if>
                                </div>

                            </div>
                            <legend>基本信息</legend>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">标题：</label>
                                <div class="col-sm-8">
                                    ${resultMap.tBugSource.title}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">问题产品：</label>
                                <div class="col-sm-4" style="margin-top: 8px">
                                    ${resultMap.tBugSource.demandProductName}
                                </div>
                                <label class="col-sm-2 control-label">反馈来源：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.feedbackSource}


                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">反馈城市：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.feedbackCity}

                                </div>
                                <label class="col-sm-2 control-label">反馈人：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.feedbackName}
                                </div>

                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label">反馈时间：</label>
                                <div class="col-sm-4">
                                    <div class="input-group date">
                                        ${resultMap.tBugSource.feedbackTime}

                                    </div>

                                </div>


                                <!-- 部门列表-->

                                <label class="col-sm-2 control-label">处理部门：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.department}
                                </div>

                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label">紧急度：</label>
                                <div class="col-sm-4">
                                    <c:if test="${resultMap.tBugSource.priority==1}">
                                        一级
                                    </c:if>

                                    <c:if test="${resultMap.tBugSource.priority==2}">
                                        二级
                                    </c:if>
                                    <c:if test="${resultMap.tBugSource.priority==3}">
                                        三级
                                    </c:if>

                                    <c:if test="${resultMap.tBugSource.priority==4}">
                                        四级
                                    </c:if>

                                    <c:if test="${resultMap.tBugSource.priority==5}">
                                        五级
                                    </c:if>


                                </div>

                                <label class="col-sm-2 control-label">录入时间：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.createTime}

                                </div>


                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">录入人：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tBugSource.createName}

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">问题描述：</label>
                                <div class="col-sm-10">
                                    ${resultMap.tBugSource.detail}

                                </div>


                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">附件：</label>
                                <div class="col-sm-5">
                                    <c:forEach
                                            items="${resultMap.files1}"
                                            var="files">
                                        <a target="_blank"
                                           href="${files.url}">${files.file_names}</a><br>
                                    </c:forEach>
                                </div>


                            </div>
                        </fieldset>
                        <!-- 循环遍历进度信息-->
                        <c:forEach items="${resultMap.proList}" var="pro" varStatus="index">
                            <c:if test="${index.index == 0}">
                                <fieldset>

                                    <legend>审核信息</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">项目经理：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>

                                        <label class="col-sm-2 control-label">审核结果：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.is_receive == 1}">已通过</c:if>
                                            <c:if test="${pro.is_receive == 2}">已驳回</c:if>
                                        </div>
                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">开发人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.programmer}
                                        </div>

                                        <label class="col-sm-2 control-label">审核时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-10">
                                                ${pro.remark}
                                        </div>
                                    </div>


                                </fieldset>
                            </c:if>
                            <c:if test="${index.index == 1}">
                                <fieldset>

                                    <legend>处理信息</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">开发人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>


                                        <label class="col-sm-2 control-label">处理时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">处理状态：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.status != 6}">
                                                <c:if test="${pro.finish_time != null}">已处理</c:if>
                                                <c:if test="${pro.finish_time == null}">处理中</c:if>
                                            </c:if>
                                            <c:if test="${pro.status == 6}">
                                                已驳回
                                            </c:if>
                                        </div>
                                        <label class="col-sm-2 control-label">完成时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.finish_time}
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-4">
                                                ${pro.remark}
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">附件：</label>
                                        <div class="col-sm-10">
                                            <c:forEach items="${pro.filesList}" var="files">
                                                <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                            </c:forEach>
                                        </div>
                                    </div>


                                </fieldset>
                            </c:if>
                            <c:if test="${index.index == 2}">
                                <fieldset>
                                    <legend>验收信息</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">验收人：</label>
                                        <div class="col-sm-4">
                                                ${pro.opertion_name}
                                        </div>

                                        <label class="col-sm-2 control-label">验收结果：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.is_receive == 1}">已通过</c:if>
                                            <c:if test="${pro.is_receive == 2}">已驳回</c:if>
                                        </div>


                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">验收时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.opertion_time}
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">验收意见：</label>
                                        <div class="col-sm-10">
                                                ${pro.remark}
                                        </div>
                                    </div>

                                </fieldset>
                            </c:if>
                        </c:forEach>
                        <fieldset>
                            <div class="form-group">
                                <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                    <c:if test="${isCheck != null && resultMap.tBugSource.status == 1}">
                                        <input value="通过" bugId="${resultMap.tBugSource.id}" isReceive="1"
                                               departmentId="${resultMap.tBugSource.departmentId}"
                                               status="${resultMap.tBugSource.status}" class="btn  btn-primary"
                                               type="button"
                                               id="submitBtn">
                                        <button class="btn  btn--white" isReceive="2"
                                                bugId="${resultMap.tBugSource.id}" isReceive="1"
                                                departmentId="${resultMap.tBugSource.departmentId}"
                                                status="${resultMap.tBugSource.status}"
                                                style="background-color: #f7a54a;color: white" type="button">驳回
                                        </button>
                                    </c:if>
                                    <button id="closeBut" onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>


                </div>

                <div id="tab-2" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table id="cusTable"
                                   class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>操作人
                                    </td>
                                    <td>暂停时间
                                    </td>
                                    <td>暂停原因
                                    </td>
                                    <td>开始时间
                                    </td>
                                    <td>开始原因
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.supList}" var="sup">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${sup.operation_name}
                                        </td>
                                        <td>
                                                ${sup.operation_time}
                                        </td>
                                        <td>
                                                ${sup.suspend_cause}
                                        </td>
                                        <td>
                                                ${sup.start_time}
                                        </td>
                                        <td>
                                                ${sup.begin_cause}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
                <div id="tab-3" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table
                                    class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>转移人
                                    </td>
                                    <td>转移时间
                                    </td>
                                    <td>转移原因
                                    </td>
                                    <td>接收人
                                    </td>
                                    <td>转移进度
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.traList}" var="tra">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${tra.transfer_name}
                                        </td>
                                        <td>
                                                ${tra.transfer_time}
                                        </td>
                                        <td>
                                                ${tra.remark}
                                        </td>
                                        <td>
                                                ${tra.receiver_name}
                                        </td>
                                        <td>
                                                ${tra.transfer_status}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
            </div>
        </div>


        <!--<fieldset>-->
        <!--<legend>字段名</legend>-->
        <!--<div class="form-group">-->
        <!--<label for="disabledSelect" class="col-sm-2 control-label">表名</label>-->
        <!--<div class="col-sm-10">-->
        <!--<select id="disabledSelect" class="form-control">-->
        <!--<option>禁止选择</option>-->
        <!--<option>禁止选择</option>-->
        <!--</select>-->
        <!--</div>-->
        <!--</div>-->
        <!--</fieldset>-->
    </form>
</div>


<script>
    function closeWin() {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index); //再执行关闭
    }

    $(document).ready(function () {
        $("#demandForm").validate({

            rules: {

                title: {
                    required: true,
                },
                department: {
                    min: 0,
                },
                principal: {
                    min: 0,
                }
            },
            messages: {
                title: {
                    required: '请填写标题'
                },

                feedback_name: {
                    required: '请填写反馈人姓名'
                },
                department: {
                    min: '请选择部门'
                },
                principal: {
                    min: '请选择部门负责人'
                }
            }
        });
        $('.loopitem').eq(0).find('.dir_line').hide()
    });


    //弹出页面
    $(".btn").click(function () {

        var isReceive = $(this).attr('isReceive');

        var title = "BUG审核-通过";
        if (2 == isReceive) {
            title = "BUG审核-驳回";
        }

        //alert($(this).html());
        //alert($(this).attr('status'));
        //alert($(this).attr('bug_id'));
        //alert($(this).parent('tr').attr('custId'));
        index = layer.open({
            type: 2,
            title: title,
            skin: 'ilayui-layer-rm', //加上边框
            area: ['30%', '65%'], //宽高
            content: 'goCheckBugPage.html?departmentId=' + $(this).attr('departmentId') +
            "&id=" + $(this).attr('bugId') + "&status=" + $(this).attr('status')
            + "&isReceive=" + isReceive
            // end: function () {
            // location.reload();
            // }

        });
    });
</script>
</body>
</html>
